package com.winit;

import com.winit.operation.BeetleOathUpdator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@EnableTransactionManagement
@EnableScheduling
@SpringBootApplication(scanBasePackages = "com.winit")
public class Application {
    private static Logger log = LoggerFactory.getLogger(BeetleOathUpdator.class);
    public static void main(String[]args) throws Exception{
//        SpringApplication.run(Application.class, args);
        ConfigurableApplicationContext configurableApplicationContext = SpringApplication.run(Application.class, args);
        log.info("程序启动完成，执行第一次同步任务:BeetleOathUpdator");
        configurableApplicationContext.getBean(BeetleOathUpdator.class).execute();
    }
}
